package com.dongss.study.controller;

import com.dongss.study.common.utils.ResultVo;
import org.apache.shiro.SecurityUtils;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * Created by dongshuanshuan on 17-7-29.
 */
@Controller
public class IndexController {

    @RequestMapping("admin/hello")
    public String hello(){
        return "hello";
    }

    @RequestMapping("admin/currentUser")
    @ResponseBody
    public ResultVo currentUser(){

        String username=(String) SecurityUtils.getSubject().getPrincipal();
        return new ResultVo("0","获取成功",username);
    }
}
